<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">常用贴库</strong></div>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label>内容描述</label> <input type="text" class="am-form-field" ng-model="desc">
        </div>
        <button id="search-target" data-am-modal="{target: '#loading'}" type="submit" class="am-btn am-btn-primary left-margin" ng-click="search()" data-target="cascad-search">搜索</button>
    </form>
    <br>
    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-add', width: 800, height: 600}"><span class="am-icon-plus"></span> 新增</button>
        <button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>
    </div>
    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <th class="table-title">类别</th>
                    <th class="table-title">版块</th>
                    <!--<th class="table-title">内容分类</th>-->
                    <th class="table-title">描述</th>
                    <th class="table-title">创建日期</th>
                    <th class="table-title">最后修改日期</th>
                    <th class="table-title">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="question in questionStoreList" id = "{{question.objId}}">
                    <td class="table-check"><input type="checkbox" class = "item-check"></td>
                    <!--<td>{{if(question.storetype==)}}</td>-->
                    <td ng-show="question.storetype=='init'">初始化贴</td>
                    <td ng-show="question.storetype=='op'">运营贴</td>
                    <!--<td>{{question.category}}</td>-->
                    <td ng-show="question.category=='question'">邻里问问</td>
                    <td ng-show="question.category=='share'">随便说说</td>
                    <!--<td>{{question.contentType}}</td>-->
                    <td>{{question.desc}}</td>
                    <td>{{question.dateCreated | date:'yyyy-MM-dd'}}<br>{{question.dateCreated | date:'HH:mm:ss'}}</td>
                    <td>{{question.dateLastModified | date:'yyyy-MM-dd'}}<br>{{question.dateLastModified | date:'HH:mm:ss'}}</td>
                    <td>
                        <button class="am-btn am-btn-default am-btn-xs am-text-secondary" data-am-modal="{target: '#doc-modal-{{$index}}', width: 800, height: 600}"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                        <!--编辑框 -->
                        <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-{{$index}}">
                            <div class="am-modal-dialog">
                                <div class="am-modal-hd border-bottom" style = "text-align: left;">编辑帖子
                                    <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                                </div>
                                <div class="am-modal-bd body-area">
                                    <div class = "text-left" style = "width:90%">
                                        <form>
                                            <div><label>类别</label>
                                                <select style = "width: 200px;height: 38px;display: inline-block;" ng-model="question.storetype" required>
                                                    <option value="op">运营贴</option>
                                                    <option value="init">初始化贴</option>
                                                </select>
                                            </div><br>
                                            <div><label>版块</label>
                                                <select style = "width: 200px;height: 38px;display: inline-block;" ng-model="question.category" required>
                                                    <option value="question">邻里问问</option>
                                                    <option value="share">随便说说</option>
                                                </select>
                                            </div>
                                            <br>
                                            <div>
                                                <label>描述</label><textarea type="text" class = "modal-textarea" style="width:600px;height:190px;"  ng-model="question.desc"></textarea>
                                            </div>
                                            <br>
                                            <div>
                                                <slide ng-repeat="img in question.images" active="img.active">
                                                    <img ng-src="{{img.imageURL}}" style="width: 100px;" onclick="if($(this).width()==100){
                                                    $('img').width(100);
                                                    $(this).width(360);
                                                    }else{
                                                    $(this).width(100);
                                                    };">
                                                </slide>
                                            </div>
                                    </form>
                                    </div>
                                </div>
                                <div class = "button-area border-top">
                                    <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="update(question,$index)">保存</button>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>

    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>
    <!--新增框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">新增帖子
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div class = "text-left" style = "width:90%">
                    <form>
                    <div><label>类别</label>
                        <select style = "width: 200px;height: 38px;display: inline-block;" ng-model="addData.storetype" required>
                            <option value="op">运营贴</option>
                            <option value="init">初始化贴</option>
                        </select>
                        <!--<input type="text" class = "modal-input" ng-model="addData.type">-->
                    </div>
                    <br>
                    <div><label>版块</label>
                        <select style = "width: 200px;height: 38px;display: inline-block;" ng-model="addData.category" required>
                            <option value="question">邻里问问</option>
                            <option value="share">随便说说</option>
                        </select>
                        <!--<input type="text" class = "modal-input" ng-model="addData.module">-->
                    </div>
                    <!--<div><label>内容分类</label><input type="text" class = "modal-input" ng-model="addData.contentType"></div>-->
                    <br>
                    <div>
                        <label>描述</label>
                        <textarea type="text" style="width:600px;height:190px;" ng-model="addData.desc"></textarea>
                    </div>
                    <br>
                    <div>
                        <label  style="width:auto">图片(最多可上传6张):</label>
                        <input type="file" id="images_upload"
                               onchange="angular.element(this).scope().selectFile(this.files)" multiple accept="image/*">
                        <div id="image_result" class="image-result"></div>
                    </div>
                </form>
                </div>
            </div>

            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="add(addData)">保存</button>
            </div>
        </div>
    </div>
</div>